<template>
	<div style="display: flex;flex-direction: column;" class="otherPage centreOfExcellence manpowerAnnouncementInfo">
		<Header :selected="8"></Header>
		<div class="bannerArea">
			<div class="banner" :style="bg_img? 'background:url('+bg_img+') no-repeat;background-size:cover;':''"></div>
		</div>
		<Navigation v-loading="loading" :items="breadcrumbItems" :menus="menus" :checked="4" :bgColor="bgColor">
		</Navigation>
		<div class="content" style="min-height: 600px;">
			<div class="content_bg" style="min-height: 600px;">
				<el-row>
					<el-col class="corporateNewsDetailTitle">
						{{data.titles}}
					</el-col>
					<el-col class="corporateNewsDetailDate">
						{{$t("releaseDate")}}{{data?"："+data.publishTime:""}}
					</el-col>
					<el-col class="corporateNewsDetailDescription">
						<div v-html="data.content.setWrap()"></div>
					</el-col>
				</el-row>
			</div>
		</div>
		<Footer></Footer>
	</div>
</template>

<script>
	import Header from '../../components/common/header/Header.vue'
	import Navigation from '../../components/common/navigation/Navigation.vue'
	import Footer from '../../components/common/footer/Footer.vue'
	import Pagination from '../../../src/components/common/Pagination.vue'
	import {
		fmtDate
	} from '../../utils/tools'
	import {
		centreOfExcellenceMenu
	} from '../../utils/menu.js'
	// 导入您需要的模块
	import Swiper from "swiper";
	export default {
		components: {
			Header,
			Navigation,
			Footer,
			Pagination,
			fmtDate
		},
		data() {
			return {
				loading: true,
				bg_img: '', //头部banner，默认值已绑定，有背景自动切换
				bgColor: "white", //white/red
				pageSize: 4,
				total: 1000,
				currentPage: 1,
				menus: centreOfExcellenceMenu,
				breadcrumbItems: [{
						label: this.$t('home'),
						to: '/'
					},
					{
						label: this.$t('centreOfExcellence'),
						to: '/centreOfExcellence'
					},
					{
						label: this.$t('manpowerAnnouncement'),
						to: '/manpowerAnnouncement'
					}
				],
				hoverIndex: -1,

				data: {
					titles: '',
					publishTime: '',
					content: ''
				},
				id: null

			};
		},
		computed: {},
		created() {},
		mounted() {
			this.bindBg()
			this.id = this.$route.query.id;
			this.bindRecruitNoticePageInfo();
		},
		methods: {
			/**
			 * 获取人力公告内容
			 */
			bindRecruitNoticePageInfo() {
				let params = {
					recruitNoticeId: this.id
				};
				let that = this;
				that.$request.recruitNoticeDetail(params).then(res => {
					this.data = res.data
					this.loading = false;
				}).catch((error) => {
					console.log(error);
				});

			},
			/**
			 *获取人力公告顶部背景
			 */
			bindBg() {
				let params = {};
				let that = this;
				that.$request.rlGgBgImage(params).then(res => {
					this.bg_img = res.data.fileUrl
				}).catch((error) => {
					console.log(error);
				});
			},
			gotoInfo(id) {
				this.$router.push({
					name: this.$t('manpowerAnnouncementInfo'),
					query: {
						id: id
					}
				});
			},
			formatDate(date, format) {
				// 自定义日期格式化方法
				// 可以使用moment.js或其他日期处理库来进行格式化
				console.log('dateFormatFun(date)', date)
				return fmtDate(new Date(date), format);
			},
		}
	}
</script>

<style scoped>
	@import url("../../components/common/css/centreOfExcellence/centreOfExcellence.css");

	.manpowerAnnouncementInfo .newArea {
		height: auto;
	}

	.manpowerAnnouncementInfo .paginationArea {
		height: 70px;
		line-height: 70px;
		justify-content: center;
		padding-top: 20px;
	}

	.manpowerAnnouncementInfo .moreInfoBtn {
		width: 97px;
		height: 30px;
		line-height: 30px;


		text-align: center;
		color: #0484D7;

		font-size:
			16px;
		margin-top: 2vh;
		margin-left: 10px;
	}

	.manpowerAnnouncementInfo .moreInfoBtn:hover {
		background-color: ##0396f0;
		color: #0396f0;
	}

	.manpowerAnnouncementInfo .news-list .news-item {
		height: 22vh;
		/* 	margin-bottom: 1vh ; */
		border-bottom: 2px solid #E8E6E5;
	}



	.manpowerAnnouncementInfo .news-list .date {
		border-bottom: 2px solid #E8E6E5;
		height: 20vh;
		background: #EDEDED;
	}

	.manpowerAnnouncementInfo .news-list .title {
		font-size: 16px;
		font-weight: 400;
		color: #333333;
		line-height: 34px;
	}

	.manpowerAnnouncementInfo .news-list .number-of-views {
		font-size: 14px;
		font-weight: 400;
		color: #999999;
		line-height: 34px;
	}

	.manpowerAnnouncementInfo .news-list .description {
		font-size: 14px;
		font-weight: 400;
		color: #666666;
		line-height: 34px;
	}

	.manpowerAnnouncementInfo .news-list .day {
		text-align: center;
		font-size: 2em;
		padding-top: 5vh;
		height: 12vh;
		font-weight: 400;
		color: #0484D7;
	}



	.manpowerAnnouncementInfo .news-list .month-year {
		text-align: center;
		font-size: 1.2em;
	}

	.manpowerAnnouncementInfo .btn-next span {
		min-width: 50px !important;
	}

	.el-pagination span:not([class*=suffix]) {
		display: inline-block;
		font-size: 13px;
		min-width: 50px !important;
		height: 28px;
		line-height: 28px;
		vertical-align: top;
		-webkit-box-sizing: border-box;
		box-sizing: border-box;
	}

	.news-item {
		margin-bottom: 20px;
		cursor: pointer;
		overflow: hidden;
		transition: transform 0.3s ease;
		/* 添加过渡效果 */
	}

	.manpowerAnnouncementInfo .news-item:hover {
		transform: scale(0.98)
	}


	.corporateNewsDetailTitle {
		height: 40px;
		line-height: 40px;
		font-size: 20px;
		text-align: center;
		font-weight: 530;
		color: #333333;
	}

	.corporateNewsDetailDate {
		text-align: center;
		height: 40px;
		line-height: 40px;
		font-weight: 400;
		color: #999999;
		line-height: 33px;
	}

	.corporateNewsDetailDescription {
		font-size: 16px;
		font-weight: 400;
		color: #666666;
		line-height: 27px;
	}
</style>
